﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;

namespace CodeC.Infrastructure.Controls
{
    /// <summary>
    /// This class is extension method of ListBox control, it refresh the seletedItem when mouse button up
    /// </summary>
    public class CodeCListBox : ListBox
    { 
        protected override void OnMouseLeftButtonUp(System.Windows.Input.MouseButtonEventArgs e)
        {
            dynamic tempSelectedItem = this.SelectedItem;
            this.SelectedItem = null;
            this.SelectedItem = tempSelectedItem;

            base.OnMouseLeftButtonUp(e);
        }
    }
}
